<?php
/**
 * the router resource catches the URI before it the front controller has been dispatched
 * it then creates a new instance of http request and passes it to the front controller
 *
 */
class Dig_Application_Resource_Request extends Zend_Application_Resource_ResourceAbstract
{
    public function init ()
    {
        $options = $this->getOptions();
        $uri = Dig_Uri::factory(Dig_Uri::toString());
        $frontController = $this->getBootstrap()->getResource('frontController');
        $request = new Zend_Controller_Request_Http();
        $request->setRequestUri($uri->uri);
        $request->setParams($uri->params);
        $frontController->setRequest($request);
        return $request;
    }
    
}

